<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@page language="java" import="cameraConfig.*" import="user.*" import="utils.*" contentType="text/html" pageEncoding="UTF-8"%>
<%@page errorPage="error.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<c:if test="${!user.isLoggedIn() || user.isInactive()}">
	<c:redirect url="error.jsp" />
</c:if>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Administration</title>
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/Resources/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/Resources/Styles/back.css">
<script
	src="${pageContext.request.contextPath}/Resources/Scripts/jquery.min.js"></script>
<script
	src="${pageContext.request.contextPath}/Resources/Scripts/script.js"></script>
<script
	src="${pageContext.request.contextPath}/Resources/bootstrap/js/bootstrap.min.js"
	type="text/javascript"></script>
</head>
<body>
	<c:if test="${!empty errorMessage}">
		<strong>Oooops... folgender Fehler ist aufgetreten:</strong>
		<p>${errorMessage}</p>
		<p>Bitte loggen Sie sich ein!</p>
		<a href="login.html">Zur Login Seite wechseln</a>
	</c:if>
	<c:if test="${empty errorMessage}">
		<form action="AddUserController" name="appform" method="post" id="target"
			class="form-horizontal">
			<div class="item-active">
				<div class="container">
					<div class="panel active">
						<ul class="nav nav-tabs nav-pills" id="myTab">
							<li class=""><a class="cameraFilter" href="#cameraFilter" data-toggle="tab">Cameras</a>
								<c:if test="${user.isAdmin()}">
									<li class="active dropdown"><a class="dropdown-toggle"
										data-toggle="dropdown">Management<span class="caret"></span></a>
										<ul class="dropdown-menu" role="menu">
											<li><a class="addUser" href="#addUser" data-toggle="tab">Add
													New user</a></li>
											<li><a class="showUsers" href="ShowUsers"
												data-toggle="tab">Show User List</a></li>
											<li><a class="editCameras" href="#EditCameras"
												data-toggle="tab">Camera Management</a></li>
										</ul></li>
								</c:if>
							<li class=""><a href="#" data-toggle="tab">About</a>
							<li class="pull-right"><a class="logout" href="#"
								data-toggle="tab">Logout</a>
						</ul>
						<br>
						<div class="tab-content">
							<c:if test="${user.isAdmin()}">
								<div class="row">
									<fieldset>
										<div class="form-group">
											<label for="loginname" class="col-lg-3 control-label">Loginname:</label>
											<div class="col-md-6">
												<input type="text" required="" class="form-control input-md"
													placeholder="Loginname" name="username" id="loginname">
												<span class="help-block">Enter loginname here</span>
											</div>
										</div>
										<div class="component"
											data-content="&lt;form role=&quot;form&quot;&gt;"
											data-title="Text Input" data-trigger="manual"
											data-html="true">
											<!-- Text input-->
											<div class="form-group">
												<label for="username" class="col-lg-3 control-label">Username:</label>
												<div class="col-md-6">
													<input type="text" required=""
														class="form-control input-md" placeholder="Username"
														name="fullname" id="username"> <span
														class="help-block">Enter username here</span>
												</div>
											</div>
										</div>
										<div class="component"
											data-content="&lt;form role=&quot;form&quot;&gt;"
											data-title="Text Input" data-trigger="manual"
											data-html="true">
											<!-- Text input-->
											<div class="form-group">
												<label for="location" class="col-lg-3 control-label">Location:</label>
												<div class="col-md-6">
													<select class="form-control" name="location" id="location">
														<c:forEach items="${locations}" var="location">
															<option value="${location.getName()}">${location.getName()}</option>
														</c:forEach>
													</select>
													<span class="help-block">Choose location here</span>
												</div>
											</div>
										</div>
										<div class="component"
											data-content="&lt;form role=&quot;form&quot;&gt;"
											data-title="Password Input" data-trigger="manual"
											data-html="true">
											<!-- Password input-->
											<div class="form-group">
												<label for="password" class="col-lg-3 control-label">Password:</label>
												<div class="col-md-6">
													<input type="password" required=""
														class="form-control input-md" placeholder="Password"
														name="password" id="password"> <span
														class="help-block">Enter user password here</span>
												</div>
											</div>
										</div>
										<div class="component"
											data-content="&lt;form role=&quot;form&quot;&gt;"
											data-title="Password Input" data-trigger="manual"
											data-html="true">
											<!-- Password input-->
											<div class="form-group">
												<label for="confPassword" class="col-lg-3 control-label">Confirm
													password:</label>
												<div class="col-md-6">
													<input type="password" required=""
														class="form-control input-md"
														placeholder="Confirm password" name="confPassword"
														id="confPassword"> <span class="help-block">Confirm
														password here</span>
												</div>
											</div>
										</div>
										<div class="component"
											data-content="&lt;form role=&quot;form&quot;&gt;"
											data-title="Select Basic" data-trigger="manual"
											data-html="true">
											<!-- Select Basic -->
											<div class="form-group">
												<label for="userGroup" class="col-lg-3 control-label">User
													group:</label>
												<div class="col-md-6">
													<select class="form-control" name="admin" id="userGroup">
														<option value="0">User</option>
														<option value="1">Admin</option>
													</select>
												</div>
											</div>
										</div>
										<div class="component"
											data-content="&lt;form role=&quot;form&quot;&gt;"
											data-title="Select Basic" data-trigger="manual"
											data-html="true">
											<!-- Select Basic -->
											<div class="form-group">
												<label for="active" class="col-lg-3 control-label">Inactive:</label>
												<div class="col-md-6">
													<select class="form-control" name="inactive" id="active">
														<option value="1">Yes</option>
														<option value="0">No</option>
													</select>
												</div>
											</div>
										</div>
										<div class="component"
											data-content="&lt;form role=&quot;form&quot;&gt;"
											data-title="Button" data-trigger="manual" data-html="true">
											<div class="form-group">
												<div class="col-md-6">
													<label for="brnOk" class="col-lg-3 control-label"></label>
													<button name="btnAdduser" value="OK" type="submit"
														class="btn btn-primary" style="width: 8em">OK</button>
												</div>
											</div>
										</div>
									</fieldset>
								</div>
							</c:if>
						</div>
					</div>
				</div>
			</div>
		</form>
	</c:if>
</body>
</html>
